package netdemo;

import java.io.IOException;
import java.net.*;
import java.nio.charset.StandardCharsets;

public class UDPClient {

    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket=new DatagramSocket(10000);
        DatagramPacket datagramPacket=new DatagramPacket("hello".getBytes(StandardCharsets.UTF_8),"hello".getBytes().length, InetAddress.getByName("localhost"),10001);
        datagramSocket.send(datagramPacket);
        datagramSocket.close();
    }
}
